﻿using SqlSugar;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Learun.Application.Base.SystemModule
{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创建人：研发部
    /// 日 期：2017.03.08
    /// 描 述：自定义查询
    /// </summary>
    [SugarTable(TableName = "LR_BASE_CUSTMERQUERY")]
    public class CustmerQueryEntity
    {
        #region 实体成员
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(ColumnName = "F_CUSTMERQUERYID", IsPrimaryKey = true)]
        public string F_CustmerQueryId { get; set; }
        /// <summary>
        /// 查询名称
        /// </summary>
        [SugarColumn(ColumnName = "F_NAME")]
        public string F_Name { get; set; }
        /// <summary>
        /// 所属成员
        /// </summary>
        [SugarColumn(ColumnName = "F_USERID")]
        public string F_UserId { get; set; }
        /// <summary>
        /// 功能模块ID
        /// </summary>
        [SugarColumn(ColumnName = "F_MODULEID")]
        public string F_ModuleId { get; set; }
        /// <summary>
        /// 所属功能连接地址
        /// </summary>
        [SugarColumn(ColumnName = "F_MODULEURL")]
        public string F_ModuleUrl { get; set; }
        /// <summary>
        /// 查询的公式
        /// </summary>
        [SugarColumn(ColumnName = "F_FORMULA")]
        public string F_Formula { get; set; }
        /// <summary>
        /// 查询的条件
        /// </summary>
        [SugarColumn(ColumnName = "F_QUERYJSON")]
        public string F_QueryJson { get; set; }


        #endregion

        #region 扩展操作
        /// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
            this.F_CustmerQueryId = Guid.NewGuid().ToString();
        }
        /// <summary>
        /// 编辑调用
        /// </summary>
        /// <param name="keyValue">主键</param>
        public void Modify(string keyValue)
        {
            this.F_CustmerQueryId = keyValue;
        }
        #endregion

        #region 扩展字段
        /// <summary>
        /// 模块名称
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string ModuleName { get; set; }
        #endregion
    }
}
